<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>XPath测试页面</title>
    <style>
        body {
            font-family: Arial, sans-serif;
            max-width: 800px;
            margin: 0 auto;
            padding: 20px;
            line-height: 1.6;
        }
        .header {
            background: #f4f4f4;
            padding: 20px;
            border-radius: 5px;
            margin-bottom: 20px;
        }
        .content {
            background: white;
            padding: 20px;
            border: 1px solid #ddd;
            border-radius: 5px;
        }
        .product-list {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
            gap: 20px;
            margin-top: 20px;
        }
        .product-item {
            border: 1px solid #eee;
            padding: 15px;
            border-radius: 5px;
            background: #fafafa;
        }
        .product-title {
            font-size: 18px;
            font-weight: bold;
            color: #333;
            margin-bottom: 10px;
        }
        .product-price {
            color: #e74c3c;
            font-size: 20px;
            font-weight: bold;
        }
        .product-description {
            color: #666;
            margin: 10px 0;
        }
        .btn {
            background: #3498db;
            color: white;
            padding: 8px 16px;
            border: none;
            border-radius: 3px;
            cursor: pointer;
        }
        .btn:hover {
            background: #2980b9;
        }
    </style>
</head>
<body>
    <div class="header">
        <h1 id="main-title" class="page-title">电商产品展示页面</h1>
        <p class="subtitle">这是一个用于测试XPath定位的示例页面</p>
    </div>

    <div class="content">
        <h2 data-section="products">热门产品</h2>
        
        <div class="product-list">
            <div class="product-item" data-product-id="1001">
                <div class="product-title">智能手机 Pro Max</div>
                <div class="product-price">¥8,999</div>
                <div class="product-description">最新款智能手机，配备先进的AI芯片和高清摄像头</div>
                <button class="btn add-to-cart" data-action="add-cart" data-product="1001">加入购物车</button>
            </div>

            <div class="product-item" data-product-id="1002">
                <div class="product-title">无线耳机 AirPods</div>
                <div class="product-price">¥1,299</div>
                <div class="product-description">高品质无线耳机，支持主动降噪和无线充电</div>
                <button class="btn add-to-cart" data-action="add-cart" data-product="1002">加入购物车</button>
            </div>

            <div class="product-item" data-product-id="1003">
                <div class="product-title">智能手表 Series 9</div>
                <div class="product-price">¥2,599</div>
                <div class="product-description">健康监测、运动追踪、智能通知一应俱全</div>
                <button class="btn add-to-cart" data-action="add-cart" data-product="1003">加入购物车</button>
            </div>

            <div class="product-item" data-product-id="1004">
                <div class="product-title">平板电脑 iPad Air</div>
                <div class="product-price">¥4,399</div>
                <div class="product-description">轻薄便携，适合办公和娱乐的高性能平板</div>
                <button class="btn add-to-cart" data-action="add-cart" data-product="1004">加入购物车</button>
            </div>
        </div>

        <div class="footer-info" style="margin-top: 40px; padding-top: 20px; border-top: 1px solid #eee;">
            <h3>购买须知</h3>
            <ul>
                <li class="notice-item">所有产品享受7天无理由退货</li>
                <li class="notice-item">免费配送，订单满299元包邮</li>
                <li class="notice-item">正品保证，假一赔十</li>
            </ul>
        </div>
    </div>

    <script>
        // 添加一些交互功能
        document.querySelectorAll('.add-to-cart').forEach(button => {
            button.addEventListener('click', function() {
                const productId = this.getAttribute('data-product');
                alert(`产品 ${productId} 已加入购物车！`);
            });
        });
    </script>
</body>
</html>